Trò chơi Angry Birds trong UNITY Engine
31.715 lượt xem;
1 public static class GoEaseQuartic
2 {
3 public static float EaseIn( float t, float b, float c, float d )
4 {
5 return c * ( t /= d ) * t * t * t + b;
6 }
7
8 public static float EaseOut( float t, float b, float c, float d )
9 {
10 return -c * ( ( t = t / d - 1 ) * t * t * t - 1 ) + b;
11 }
12
13 public static float EaseInOut( float t, float b, float c, float d )
14 {
15 if( ( t /= d / 2 ) < 1 )
16 {
17 return c / 2 * t * t * t * t + b;
18 }
19 return -c / 2 * ( ( t -= 2 ) * t * t * t - 2 ) + b;
20 }
21 }
2 {
3 public static float EaseIn( float t, float b, float c, float d )
4 {
5 return c * ( t /= d ) * t * t * t + b;
6 }
7
8 public static float EaseOut( float t, float b, float c, float d )
9 {
10 return -c * ( ( t = t / d - 1 ) * t * t * t - 1 ) + b;
11 }
12
13 public static float EaseInOut( float t, float b, float c, float d )
14 {
15 if( ( t /= d / 2 ) < 1 )
16 {
17 return c / 2 * t * t * t * t + b;
18 }
19 return -c / 2 * ( ( t -= 2 ) * t * t * t - 2 ) + b;
20 }
21 }